package com.yuma.observe;

public class ObserveTest {
    public static void main(String[] args) {
        Saler saler = new Saler();
        Buyer buyer1 = new Buyer("张三", saler);
        buyer1.join();
        Buyer buyer2 = new Buyer("李四", saler);
        buyer2.join();
        Buyer buyer3 = new Buyer("王五", saler);
        buyer3.join();

        saler.sendMessage("你好，我是店主，华子到货了");
        System.out.println("---------------------");
        buyer3.quit();

        saler.sendMessage("你好，我是店主，荷花又到货了");
    }
}
